package com.ryan.ohos.extension.event;

import ohos.multimodalinput.event.MmiPoint;
import ohos.multimodalinput.event.TouchEvent;

import java.util.Objects;

public class TouchEventProxy  extends TouchEvent {

    private TouchEvent event;

    public void setEvent(TouchEvent event) {
        this.event = event;
    }

    @Override
    public int getAction() {
        return event.getAction();
    }

    @Override
    public int getIndex() {
        return event.getIndex();
    }

    @Override
    public long getStartTime() {
        return event.getStartTime();
    }

    @Override
    public int getPhase() {
        return event.getPhase();
    }

    @Override
    public MmiPoint getPointerPosition(int i) {
        // 转发至getPointerScreenPosition
        return event.getPointerScreenPosition(i);
    }

    @Override
    public void setScreenOffset(float v, float v1) {
        event.setScreenOffset(v, v1);
    }

    @Override
    public MmiPoint getPointerScreenPosition(int i) {
        return event.getPointerScreenPosition(i);
    }

    @Override
    public int getPointerCount() {
        return event.getPointerCount();
    }

    @Override
    public int getPointerId(int i) {
        return event.getPointerId(i);
    }

    @Override
    public float getForce(int i) {
        return event.getForce(i);
    }

    @Override
    public float getRadius(int i) {
        return event.getRadius(i);
    }

    @Override
    public int getSourceDevice() {
        return event.getSourceDevice();
    }

    @Override
    public String getDeviceId() {
        return event.getDeviceId();
    }

    @Override
    public int getInputDeviceId() {
        return event.getInputDeviceId();
    }

    @Override
    public long getOccurredTime() {
        return event.getOccurredTime();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TouchEventProxy that = (TouchEventProxy) o;
        return Objects.equals(event, that.event);
    }

    @Override
    public int hashCode() {
        return Objects.hash(event);
    }
}
